fn main() {
    let mut s = String::from("Hello");
    let r1 = &s;
    println!("{}", r1);

    let r2 = &s;
    println!("{}", r2);
    let r3 = &mut s;
    println!("{}", r3);

    let s1 = String::from("Hello, world!");
    let len = cal_length(&s1);
    let mut s2 = String::from("World");
    change_str_ha(&mut s2);
    println!("{}", s2);

    let s3 = &mut s2;
    change_str_hi(s3);
    println!("{}", s3);
    println!("{}", len);
    println!("{}", s1);
    let c = reference_to_nothing();
    println!("{}", c);
}

fn reference_to_nothing()->String{
    let m = String::from("Play A Game");
    m.clone()
}


fn cal_length(s: &String)->usize{
    return s.len();
}

fn change_str_ha(s: &mut String){
    s.push_str(" HaHa..");
}

fn change_str_hi(s: &mut String){
    s.push_str(" HiHi..");
}
